package com.zl.ble.util;

import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;

public class ZHandlerUtil {
    public static Handler getMainHandler() {
        return InnerMainHandler.mainHandler;
    }

    public static class InnerMainHandler {
        private static Handler mainHandler = new Handler(Looper.getMainLooper());
    }

    public static Handler getThreadHandler() {
        return InnerThreadHandler.getThreadHandler();
    }

    public static class InnerThreadHandler {
        public static Handler getThreadHandler() {
            HandlerThread handlerThread = new HandlerThread("HandlerThread");
            handlerThread.start();
            return new Handler(handlerThread.getLooper());
        }
    }
}
